package com.xbongbong.saas.domain.dao;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.entity.WorkOrderTemplateCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/5 14:04
 * @since v1.0
 * @version v1.0
 */
@Repository
@Mapper
public interface WorkOrderTemplateCategoryDao {

    Integer insert(WorkOrderTemplateCategoryEntity entity);

    Integer update(WorkOrderTemplateCategoryEntity entity);

    List<WorkOrderTemplateCategoryEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    WorkOrderTemplateCategoryEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer sort(@Param("param") Map<String, Object> param, @Param("sortMap") Map<Long, Long> sortMap);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);


    Integer updateBatch(@Param("list") List<WorkOrderTemplateCategoryEntity> updateConfigList, @Param("corpid") String corpid);


    /**
     * 批量插入实体
     * @param list
     * @return 返回数据的列表
     */
    Integer insertBatch(@Param("list") List<WorkOrderTemplateCategoryEntity> list);

}
